-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Contributions dashboard] survey dialog #5044
base: contributions-dashboard-design
Are you sure you want to change the base?
[Contributions dashboard] survey dialog #5044
Conversation
…into contributions-dashboard-design-survey-dialog
… extension for AppCompatActivity
…board-design-survey-dialog
.setTitle(titleId) | ||
.setMessage(messageId) | ||
.setCancelable(isCancellable) | ||
.setPositiveButton("Take Survey") { _, _ -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use this R.string.contributions_dashboard_survey_dialog_ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Uri.parse(activity.getString(R.string.contribution_dashboard_survey_url)) | ||
) | ||
} | ||
.setNegativeButton("No, Thanks") { _, _ -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use this R.string.contributions_dashboard_entry_dialog_cancel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should use R.string.contributions_dashboard_survey_dialog_cancel. Figma
activity: AppCompatActivity, | ||
@StringRes titleId: Int, | ||
@StringRes messageId: Int, | ||
@DrawableRes icon: Int? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will only need one survey verbiage for this experiment, maybe we can either set the title and message directly in the dialog, or set default values for title, message and icon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed from here and moved to SuggestedEditsTasksFragment
) | ||
} | ||
.setNegativeButton("No, Thanks") { _, _ -> | ||
// dismiss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need a preference for this dialog, since we are going to show this once after saving the donor history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -0,0 +1,9 @@ | |||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure but did you use the icon from the Figma design or the material design library? If it was from the Figma design, I think we can import the icon from the material design library directly in case Sarah wants the exact design from her design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icon Sarah used was in the material design library, so i imported from there.
delayMillis: Long = 0, | ||
isCancellable: Boolean = false | ||
) { | ||
activity.lifecycleScope.launch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I know why we are using the Coroutine
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
withContext(Dispatchers.Main) { | ||
dialog.show() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
@@ -750,4 +750,8 @@ object Prefs { | |||
var isRecurringDonor | |||
get() = PrefsIoUtil.getBoolean(R.string.preference_key_is_recurring_donor, false) | |||
set(value) = PrefsIoUtil.setBoolean(R.string.preference_key_is_recurring_donor, value) | |||
|
|||
var contributionDashboardSurveyDialogShown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename contribution to plural.
@@ -22,6 +22,7 @@ | |||
<string name="donate_tax_url">https://donate.wikimedia.org/wiki/Special:LandingCheck?landing_page=Tax_deductibility&basic=true</string> | |||
<string name="donate_email">[email protected]</string> | |||
<string name="donor_privacy_policy_url">https://foundation.wikimedia.org/wiki/Policy:Donor_privacy_policy</string> | |||
<string name="contribution_dashboard_survey_url">https://docs.google.com/forms/d/1wIJWp75MMyp2e51kSaPH9ctByUzbyhazEOaJTxQhKqs/edit</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: contribution
-> contributions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are no changes in this file, would it be possible to reset the change and make another PR for the format updates?
@@ -388,6 +393,32 @@ class SuggestedEditsTasksFragment : Fragment() { | |||
} | |||
} | |||
|
|||
private fun showSurveyDialog( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this dialog will not be reused in other places, can we make this even simpler, just like this?
Please make sure to add a check for the preference for the one-time popup purpose.
apps-android-wikipedia/app/src/main/java/org/wikipedia/main/MainFragment.kt
Lines 547 to 557 in 89412c1
private fun maybeShowImportReadingListsNewInstallDialog() { | |
if (!Prefs.importReadingListsNewInstallDialogShown) { | |
ReadingListsAnalyticsHelper.logReceiveStart(requireActivity()) | |
MaterialAlertDialogBuilder(requireContext()) | |
.setTitle(R.string.shareable_reading_lists_new_install_dialog_title) | |
.setMessage(R.string.shareable_reading_lists_new_install_dialog_content) | |
.setNegativeButton(R.string.shareable_reading_lists_new_install_dialog_got_it, null) | |
.show() | |
Prefs.importReadingListsNewInstallDialogShown = true | |
} | |
} |
What does this do?
Adds a function to show material alert dialog with delay functionality.
Why is this needed?
This is needed after a user Saves an update to the Donor History page.
Phabricator:
https://phabricator.wikimedia.org/T376436